//
//  SettingPresenter.m
//  ApeExample
//
//  Created by Eton on 2017/7/28.
//  Copyright © 2017年 王-庭协. All rights reserved.
//

#import "SettingPresenter.h"
#import "SettingListModel.h"

@implementation SettingPresenter

- (NSArray *)listArray{
    if (!_listArray) {
        //        NSArray * headTitles = @[@"动态设置",@"消息提醒"];
        NSArray * titles = @[@[SettingTableName_Push]];
        NSArray * details = nil;
        NSArray * subTitles = nil;
        
        NSMutableArray * resultArray = [NSMutableArray array];
        for (NSInteger i = 0; i < titles.count; i++) {
            SettingListModel * listModel = [[SettingListModel alloc] init];
            NSMutableArray * interiorArray = [NSMutableArray array];
            for (NSInteger j = 0; j < [titles[i] count]; j++) {
                SettingModel * model = [[SettingModel alloc] init];
                model.title = titles[i][j];
                model.detail = details[i][j];
                model.subTitle = subTitles[i][j];
                if (model.title == SettingTableName_Push) {
                    model.showSwitch = YES;
                }else if (model.title == SettingTableName_Password){
                    model.showAccess = YES;
                }
                [interiorArray addObject:model];
            }
            listModel.interiorArray = interiorArray;
            [resultArray addObject:listModel];
        }
        _listArray = resultArray;
    }
    return _listArray;
}

@end
